
//
//  MovieListTableViewCell.m
//  SELF 豆瓣
//
//  Created by dllo on 15/11/7.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "MovieListTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation MovieListTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self createSubviews];
    }
    
    return self;
    
}

-(void)createSubviews
{
    // 铺背景图片
    self.background = [[UIImageView alloc]initWithFrame:CGRectMake(3, 3, 365, 167)];
    self.background.image = [UIImage imageNamed:@"bg_eventlistcell.png"];
    [self.contentView addSubview:self.background];
    [_background release];
    
    
    //铺设 电影 海报名称
    self.movieLabel = [[UILabel alloc]initWithFrame:CGRectMake(137+5+10, 189/2-30, 150, 42)];

    [self.contentView addSubview:self.movieLabel];
    
    [_movieLabel release];
    
    
    
    
    
    //铺设电影海报
    self.movieImage = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 120, 160)];
    self.movieImage.backgroundColor = [UIColor purpleColor];
    [self.contentView addSubview:self.movieImage];
    self.movieImage.image = [UIImage imageNamed:@"placeHoderImage"];
    [_movieImage release];
    
    
    
}




-(void)setMovie:(Movie *)movie
{
    if (_movie != movie) {
        [_movie release];
        _movie = [movie retain];
        
    }
    self.movieLabel.text = self.movie.movieName;
    NSURL *url = [NSURL URLWithString:self.movie.pic_url];
    [self.movieImage sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeHoderImage"]];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
